# Maintainer: Rémy Oudompheng <remy@archlinux.org>

pkgname=perl-file-slurper
_dist=File-Slurper
pkgver=0.012
pkgrel=5
pkgdesc="A simple, sane and efficient module to slurp a file"
arch=('any')
url="https://metacpan.org/release/${_dist}"
license=('PerlArtistic' 'GPL')
depends=('perl')
checkdepends=('perl-test-warnings')
options=('!emptydirs')
source=(https://search.cpan.org/CPAN/authors/id/L/LE/LEONT/${_dist}-${pkgver}.tar.gz)
md5sums=('5742c63096392dfee50b8db314bcca18')
sha256sums=('4efb2ea416b110a1bda6f8133549cc6ea3676402e3caf7529fce0313250aa578')

build() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
    perl Makefile.PL
    make
}

check() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    export PERL_MM_USE_DEFAULT=1
    make test
}

package() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
}
